package com.jwsoft.manager.core.dao.model;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * PDF签章请求模板表
 *
 * @author zhang
 * @since 2025-02-06
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("pdf_sign_request")
@Schema(name = "PdfSignRequest", title = "PDF签章请求模板表", description = "PDF签章请求模板表实体类")
public class PdfSignRequest extends Model<PdfSignRequest> {

    private static final long serialVersionUID = 1L;

    @Schema(name = "id", description = "主键ID")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @Schema(name = "templateType", description = "模板类型")
    @TableField(value = "template_type")
    private String templateType;

    @Schema(name = "signType", description = "签署类型：1单页签，2多页签，3骑缝签，4关键字签")
    @TableField(value = "sign_type")
    private String signType;

    @Schema(name = "posPage", description = "页码，若为关键字定位此项无需传递，默认1")
    @TableField(value = "pos_page")
    private String posPage;

    @Schema(name = "posX", description = "X坐标，若为关键字定位，相对于关键字的X坐标偏移量，默认0")
    @TableField(value = "pos_x")
    private Float posX;

    @Schema(name = "posY", description = "Y坐标，若为关键字定位，相对于关键字的Y坐标偏移量，默认0")
    @TableField(value = "pos_y")
    private Float posY;

    @Schema(name = "keyName", description = "关键字，若为关键字定位，此项必填")
    @TableField(value = "key_name")
    private String keyName;

    @Schema(name = "sealSn", description = "印章编号")
    @TableField(value = "seal_sn")
    private String sealSn;

    @Schema(name = "pwdB64", description = "文件密码")
    @TableField(value = "pwd_b64")
    private String pwdB64;

    @Schema(name = "keyIndex", description = "指定的第N个关键字索引，默认0")
    @TableField(value = "key_index")
    private Integer keyIndex;

    @Schema(name = "addSignTime", description = "是否添加签署日期，默认false")
    @TableField(value = "add_sign_time")
    private Boolean addSignTime;

    @Schema(name = "del", description = "是否删除")
    @TableField(value = "DEL", fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NOT_NULL)
    @TableLogic
    private String del;

    @Schema(name = "createName", description = "创建人")
    @TableField(value = "CREATE_NAME", fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NOT_NULL)
    private String createName;

    @Schema(name = "createTime", description = "创建时间")
    @TableField(value = "CREATE_TIME", fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NOT_NULL)
    private Date createTime;

    @Schema(name = "updateName", description = "修改人")
    @TableField(value = "UPDATE_NAME", fill = FieldFill.INSERT_UPDATE, updateStrategy = FieldStrategy.NOT_NULL)
    private String updateName;

    @Schema(name = "updateTime", description = "修改时间")
    @TableField(value = "UPDATE_TIME", fill = FieldFill.INSERT_UPDATE, updateStrategy = FieldStrategy.NOT_NULL)
    private Date updateTime;

    @Override
    public Serializable pkVal() {
        return this.id;
    }
}
